<?php
/**
 * Created by PhpStorm.
 * User: Kui_Ye
 * Date: 2015/1/29
 * Time: 21:09
 */

include '../db_conf.php';
$uname=$_REQUEST['uname'];

//echo $uname;

$sql=mysql_query("SELECT user_pwd,code from fanwe_user where user_name='".$uname."'or mobile='".$uname."'");
$sq2=mysql_query("SELECT user_pwd,code from fanwe_user where user_name='".$uname."'or mobile='".$uname."'");

$res=mysql_fetch_assoc($sq2);
if(!$res){

    $row = array('user_pwd' => '0');
    $jarr =array('list' => $row);
    print(json_encode($jarr));
    return 0;
}
while($row=mysql_fetch_assoc($sql)) {
            $jarr = array('list' => $row);
            $out[] = $jarr;
     }
     print(json_encode($jarr));

//print(json_encode($output));
/*while($row=mysql_fetch_assoc($sql)) {
    $out[] = $row;
   // $jary = array('list' => $out);
}
print(json_encode($out));*/
mysql_close();

?>